import axios from 'axios';
import { constants } from '../store';


const getArticleContentAction = (title,content) => ({
  type: constants.GET_ARTICLE_CONTENT,
  title,
  content
})
export const getArticleContent = (id) => {
  return (dispatch) => {
    axios.get('../api/article.json?id=' + id).then((res) => {
      const result = res.data.data;
      dispatch(getArticleContentAction(result.title,result.content))
    })
  }
}
